3.1.50 \(\int \frac {\cot ^2(x)}{(a+b \cot ^2(x))^{3/2}} \, dx\) [50]

Optimal. Leaf size=59 \[ \frac {\text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{(a-b)^{3/2}}-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}} \]

[Out]

arctan(cot(x)*(a-b)^(1/2)/(a+b*cot(x)^2)^(1/2))/(a-b)^(3/2)-cot(x)/(a-b)/(a+b*cot(x)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3751, 482, 385, 209} \begin {gather*} \frac {\text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{(a-b)^{3/2}}-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[x]^2/(a + b*Cot[x]^2)^(3/2),x]

[Out]

ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]/(a - b)^(3/2) - Cot[x]/((a - b)*Sqrt[a + b*Cot[x]^2])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 482

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[e^(n - 1
)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(n*(b*c - a*d)*(p + 1))), x] - Dist[e^n/(n*(b*c -
 a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\cot ^2(x)}{\left (a+b \cot ^2(x)\right )^{3/2}} \, dx &=-\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b x^2\right )^{3/2}} \, dx,x,\cot (x)\right )\\ &=-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}}+\frac {\text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )}{a-b}\\ &=-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}}+\frac {\text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{a-b}\\ &=\frac {\tan ^{-1}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{(a-b)^{3/2}}-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(137\) vs. \(2(59)=118\).
time = 0.75, size = 137, normalized size = 2.32 \begin {gather*} \frac {(-a+b) \cot (x) \sqrt {1+\frac {b \cot ^2(x)}{a}}+\frac {1}{2} \tanh ^{-1}\left (\frac {\sqrt {-\frac {(a-b) \cot ^2(x)}{a}}}{\sqrt {1+\frac {b \cot ^2(x)}{a}}}\right ) (-a-b+(a-b) \cos (2 x)) \sqrt {-\frac {(a-b) \cot ^2(x)}{a}} \csc (x) \sec (x)}{(a-b)^2 \sqrt {a+b \cot ^2(x)} \sqrt {1+\frac {b \cot ^2(x)}{a}}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]^2/(a + b*Cot[x]^2)^(3/2),x]

[Out]

((-a + b)*Cot[x]*Sqrt[1 + (b*Cot[x]^2)/a] + (ArcTanh[Sqrt[-(((a - b)*Cot[x]^2)/a)]/Sqrt[1 + (b*Cot[x]^2)/a]]*(
-a - b + (a - b)*Cos[2*x])*Sqrt[-(((a - b)*Cot[x]^2)/a)]*Csc[x]*Sec[x])/2)/((a - b)^2*Sqrt[a + b*Cot[x]^2]*Sqr
t[1 + (b*Cot[x]^2)/a])

________________________________________________________________________________________

Maple [A]
time = 0.15, size = 99, normalized size = 1.68

method result size
derivativedivides \(-\frac {\cot \left (x \right )}{a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}-\frac {b \cot \left (x \right )}{\left (a -b \right ) a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{\left (a -b \right )^{2} b^{2}}\) \(99\)
default \(-\frac {\cot \left (x \right )}{a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}-\frac {b \cot \left (x \right )}{\left (a -b \right ) a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{\left (a -b \right )^{2} b^{2}}\) \(99\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)^2/(a+b*cot(x)^2)^(3/2),x,method=_RETURNVERBOSE)

[Out]

-cot(x)/a/(a+b*cot(x)^2)^(1/2)-1/(a-b)*b*cot(x)/a/(a+b*cot(x)^2)^(1/2)+1/(a-b)^2*(b^4*(a-b))^(1/2)/b^2*arctan(
b^2*(a-b)/(b^4*(a-b))^(1/2)/(a+b*cot(x)^2)^(1/2)*cot(x))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2/(a+b*cot(x)^2)^(3/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 173 vs. \(2 (51) = 102\).
time = 4.06, size = 388, normalized size = 6.58 \begin {gather*} \left [-\frac {{\left ({\left (a - b\right )} \cos \left (2 \, x\right ) - a - b\right )} \sqrt {-a + b} \log \left (-2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (2 \, x\right )^{2} - 2 \, {\left ({\left (a - b\right )} \cos \left (2 \, x\right ) - b\right )} \sqrt {-a + b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + a^{2} - 2 \, b^{2} + 4 \, {\left (a b - b^{2}\right )} \cos \left (2 \, x\right )\right ) + 4 \, {\left (a - b\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{4 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3} - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \cos \left (2 \, x\right )\right )}}, -\frac {{\left ({\left (a - b\right )} \cos \left (2 \, x\right ) - a - b\right )} \sqrt {a - b} \arctan \left (-\frac {\sqrt {a - b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) - b}\right ) + 2 \, {\left (a - b\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3} - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \cos \left (2 \, x\right )\right )}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2/(a+b*cot(x)^2)^(3/2),x, algorithm="fricas")

[Out]

[-1/4*(((a - b)*cos(2*x) - a - b)*sqrt(-a + b)*log(-2*(a^2 - 2*a*b + b^2)*cos(2*x)^2 - 2*((a - b)*cos(2*x) - b
)*sqrt(-a + b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x) + a^2 - 2*b^2 + 4*(a*b - b^2)*cos(2*x)
) + 4*(a - b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x))/(a^3 - a^2*b - a*b^2 + b^3 - (a^3 - 3*
a^2*b + 3*a*b^2 - b^3)*cos(2*x)), -1/2*(((a - b)*cos(2*x) - a - b)*sqrt(a - b)*arctan(-sqrt(a - b)*sqrt(((a -
b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x)/((a - b)*cos(2*x) - b)) + 2*(a - b)*sqrt(((a - b)*cos(2*x) - a -
 b)/(cos(2*x) - 1))*sin(2*x))/(a^3 - a^2*b - a*b^2 + b^3 - (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*cos(2*x))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{2}{\left (x \right )}}{\left (a + b \cot ^{2}{\left (x \right )}\right )^{\frac {3}{2}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)**2/(a+b*cot(x)**2)**(3/2),x)

[Out]

Integral(cot(x)**2/(a + b*cot(x)**2)**(3/2), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (51) = 102\).
time = 0.50, size = 161, normalized size = 2.73 \begin {gather*} -\frac {{\left (\sqrt {-a + b} \sqrt {b} \log \left ({\left | -\sqrt {-a + b} + \sqrt {b} \right |}\right ) - a + b\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{a^{2} \sqrt {b} - 2 \, a b^{\frac {3}{2}} + b^{\frac {5}{2}}} + \frac {\frac {\sqrt {-a + b} \log \left ({\left | -\sqrt {-a + b} \cos \left (x\right ) + \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a} \right |}\right )}{a^{2} - 2 \, a b + b^{2}} + \frac {\sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a} \cos \left (x\right )}{{\left (a \cos \left (x\right )^{2} - b \cos \left (x\right )^{2} - a\right )} {\left (a - b\right )}}}{\mathrm {sgn}\left (\sin \left (x\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2/(a+b*cot(x)^2)^(3/2),x, algorithm="giac")

[Out]

-(sqrt(-a + b)*sqrt(b)*log(abs(-sqrt(-a + b) + sqrt(b))) - a + b)*sgn(sin(x))/(a^2*sqrt(b) - 2*a*b^(3/2) + b^(
5/2)) + (sqrt(-a + b)*log(abs(-sqrt(-a + b)*cos(x) + sqrt(-a*cos(x)^2 + b*cos(x)^2 + a)))/(a^2 - 2*a*b + b^2)
+ sqrt(-a*cos(x)^2 + b*cos(x)^2 + a)*cos(x)/((a*cos(x)^2 - b*cos(x)^2 - a)*(a - b)))/sgn(sin(x))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {{\mathrm {cot}\left (x\right )}^2}{{\left (b\,{\mathrm {cot}\left (x\right )}^2+a\right )}^{3/2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)^2/(a + b*cot(x)^2)^(3/2),x)

[Out]

int(cot(x)^2/(a + b*cot(x)^2)^(3/2), x)

________________________________________________________________________________________